package cn.ffcs.uec.recordsApproval.component;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.zk.ui.Components;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zul.Div;

import cn.ffcs.uec.recordsApproval.component.bean.OutStaffTalentTeamEditApprovalViewExtBean;
import cn.ffcs.uom.common.util.ListboxUtils;
import cn.ffcs.uom.common.vo.NodeVo;
import lombok.Getter;

/**
 * 专家人才队伍新增弹框Ext
 * @author liuxiaodong
 *
 */
@Controller
@Scope("prototype")
public class OutStaffTalentTeamEditApprovalViewExt extends Div implements IdSpace {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6575873861762625797L;

	public static final String OUT_STAFF_TALENT_TEAM_EDIT_APPROVAL_VIEW_EXT_ZUL = 
			"/pages_nmg/recordsApproval/comp/outStaff_talentTeam_edit_approval_view_ext.zul";

	@Getter
	private OutStaffTalentTeamEditApprovalViewExtBean bean = new OutStaffTalentTeamEditApprovalViewExtBean();
	/**
	 * 构造函数
	 */
	public OutStaffTalentTeamEditApprovalViewExt() {
		Executions.createComponents(OUT_STAFF_TALENT_TEAM_EDIT_APPROVAL_VIEW_EXT_ZUL, this, null);
		Components.wireVariables(this, bean);
		Components.addForwards(this, this, '$');
		
	}

	/**
	 * 初始化
	 */
	public void onCreate() {
		this.bindCombobox();
		
		
	}
	
	/**
	 * 绑定combobox
	 */
	private void bindCombobox() {
		//人才类型
		List<NodeVo> nodeVoGlbdef10List = new ArrayList<NodeVo>();
		String[][] glbdef10 = {{"1", "实操"},
				{"2", "非实操"},
				{"", "无"}};
		for (int i = 0; i < glbdef10.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef10[i][j]);
				nodeVo.setName(glbdef10[i][j + 1]);
			}
			nodeVoGlbdef10List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef10(), nodeVoGlbdef10List);
		
		
		// 专业人才名称glbdef1
		List<NodeVo> nodeVoGlbdef1List = new ArrayList<NodeVo>();
		String[][] glbdef1 = {{"1001A1100000001Z6UFT", "IP"},
				{"1001A1100000001Z6UFU", "市场营销"},
				{"1001A1100000001Z6UFV", "行业应用与企业信息化"},
				{"1001A1100000001Z6UFW", "无线与移动"},
				{"1001A1100000001Z6UFX", "核心网"},
				{"1001A1100000001Z6UFY", "光传输与接入"},
				{"1001A1100000001Z6UFZ", "平台与终端"},
				{"1001A1100000001Z6UG0", "网络安全"}};
		for (int i = 0; i < glbdef1.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef1[i][j]);
				nodeVo.setName(glbdef1[i][j + 1]);
			}
			nodeVoGlbdef1List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef1(), nodeVoGlbdef1List);

		// 专业人才等级glbdef2
		List<NodeVo> nodeVoGlbdef2List = new ArrayList<NodeVo>();
		String[][] glbdef2 = {{"1001A1100000000006OR", "A级"},
				{"1001A1100000000006OS", "B级"}, {"1001A1100000000006OT", "C级"},
				{"1001A1100000000006OU", "D级"},
				{"1001A1100000000006OV", "集团级专业人才"},
				{"1001A1100000000006OW", "IP人才"},
				{"1001A1100000000006OX", "核心网技术"},
				{"1001A1100000000006OY", "承载网技术"},
				{"1001A1100000000006OZ", "网络安全人才"},
				{"1001A1100000000006P0", "IP人才*"},
				{"1001A1100000000006P1", "无线与移动人才"},
				{"1001A1100000000006P2", "核心网人才"},
				{"1001A1100000000006P3", "光传输与接入人才"},
				{"1001A1100000000006P4", "平台与终端人才"},
				{"1001A1100000000006P5", "行业应用和企业信息化人才"},
				{"1001A1100000000006P6", "需求分析与方案设计"},
				{"1001A1100000000006P7", "系统设计与开发"},
				{"1001A1100000000006P8", "系统运营与维护"},
				{"1001A1100000000006P9", "数据挖掘与应用"},
				{"1001A1100000000006PA", "IT人才*"}};
		for (int i = 0; i < glbdef2.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef2[i][j]);
				nodeVo.setName(glbdef2[i][j + 1]);
			}
			nodeVoGlbdef2List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef2(), nodeVoGlbdef2List);

		// 子专业：申报专业-电信 glbdef9
		List<NodeVo> nodeVoGlbdef9List = new ArrayList<NodeVo>();
		String[][] glbdef9 = {{"1001A1100000007639R3", "市场研究"},
				{"1001A1100000007639R4", "营销策划"}, 
				{"1001A1100000007639R5", "渠道管理"},
				{"1001A1100000007639R6", "客户服务"},
				{"1001A1100000007639R7", "系统规划与架构管控-行业应用"},
				{"1001A1100000007639R8", "需求分析与方案设计-行业应用"},
				{"1001A1100000007639R9", "系统设计与开发-行业应用"},
				{"1001A1100000007639RA", "系统运营与维护-行业应用"},
				{"1001A1100000007639RB", "数据挖掘与应用-行业应用"},
				{"1001A1100000007639RC", "系统规划与架构管控-企业信息化"},
				{"1001A1100000007639RD", "需求分析与方案设计-企业信息化"},
				{"1001A1100000007639RE", "系统设计与开发-企业信息化"},
				{"1001A1100000007639RF", "系统运营与维护-企业信息化"},
				{"1001A1100000007639RG", "数据挖掘与应用-企业信息化"},
				{"1001A1100000007639RH", "平台"},
				{"1001A1100000007639RI", "核心网"},
				{"1001A1100000007639RJ", "平台与核心网*"},
				{"1001A1100000007639RK", "终端"},
				{"1001A1100000007639RL", "信息安全"}};
		for (int i = 0; i < glbdef9.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef9[i][j]);
				nodeVo.setName(glbdef9[i][j + 1]);
			}
			nodeVoGlbdef9List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef9(), nodeVoGlbdef9List);
		
		// 年度考核结果 glbdef3
		List<NodeVo> nodeVoGlbdef3List = new ArrayList<NodeVo>();
		String[][] glbdef3 = {{"1001A11000000000061J", "优秀"},
				{"1001A11000000000061K", "称职"}, 
				{"1001A11000000000061M", "基本称职"},
				{"1001A11000000000061M", "不称职"},
				{"1001A11000000000061M", "反应层评估"},
				{"1001A11000000000061M", "学习层评估"},
				{"1001A11000000000061M", "行为层评估"},
				{"1001A11000000000061M", "结果层评估"}};
		for (int i = 0; i < glbdef3.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef3[i][j]);
				nodeVo.setName(glbdef3[i][j + 1]);
			}
			nodeVoGlbdef3List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef3(), nodeVoGlbdef3List);
		
		// 聘任状态 glbdef13
		List<NodeVo> nodeVoGlbdef13List = new ArrayList<NodeVo>();
		String[][] glbdef13 = {{"1001A1100000001SVL1S", "在聘"},
				{"1001A1100000001SVL1T", "退出"}};
		for (int i = 0; i < glbdef13.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef13[i][j]);
				nodeVo.setName(glbdef13[i][j + 1]);
			}
			nodeVoGlbdef13List.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getGlbdef13(), nodeVoGlbdef13List);

	}
}
